package br.edu.utfpr.md.tads.controller.adapter;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import br.edu.utfpr.md.tads.R;

public class TelefonesListAdapter extends BaseAdapter {
	private LayoutInflater inflater;
	private List<String> telefones;
	
	
	public TelefonesListAdapter(List<String> telefones,Context context) {
		super();
		this.telefones = telefones;
		this.inflater = LayoutInflater.from(context);
	}

	@Override
	public int getCount() {
		return telefones.size();
	}

	@Override
	public Object getItem(int position) {
		return telefones.get(position);
	}

	@Override
	public long getItemId(int postion) {
		// TODO Auto-generated method stub
		return postion;
	}

	@Override
	public View getView(int postion, View view, ViewGroup parent) {
		view = inflater.inflate(R.layout.layout_telefone, null);
		((TextView) view.findViewById(R.layout_telefone.text_view_telefone)).setText(telefones.get(postion));
		return view;
	}

}
